package com.gxa.web_admin.controller.hy;


import com.gxa.common.base.RespResult;
import com.gxa.modules.entity.CrmDepartment;
import com.gxa.modules.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * 查询部门
 */
@Controller
@RequestMapping("/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    /**
     * 下拉列表
     * @return
     */
    @GetMapping("/findAll")
    @ResponseBody
    public RespResult findAll(){
     List<CrmDepartment> departmentList=departmentService.findAll();
     System.out.println(departmentList);
     return RespResult.success(departmentList);
    }
}
